import Team from '../pages/TeamPage.vue';
import UserCenter from '../pages/UserCenterPage.vue';
import Index from "../pages/Index.vue";
import Search from "../pages/SmartSearchUserPage.vue";
import UserEdit from "../pages/UserEditPage.vue";
import SearchUserResultPage from "../pages/SearchUserResultByTagsPage.vue";
import TaskManagePage from '../pages/TaskManagePage.vue';
import TaskDetailPage from '../pages/TaskDetailPage.vue';
import TaskAddEditPage from '../pages/TaskAddEditPage.vue';
import TaskAssignPage from '../pages/TaskAssignPage.vue';
import Login from "../pages/LoginPage.vue";
import AddTeam from "../pages/AddTeamPage.vue";
import TeamInfo from "../pages/TeamInfoPage.vue";
import Register from "../pages/RegisterPage.vue";
import RegisterSuccess from "../pages/RegisterSuccess.vue";
import ChatPage from "../pages/ChatPage.vue";
import ChatCenter from "../pages/ChatCenterPage.vue";
import ChatInfoPage from "../pages/ChatInfoPage.vue";
import TagsSelectPage from "../pages/TagsSelectPage.vue";
import MemberCenter from "../pages/MemberCenter.vue";
import BoKeCenter from "../pages/BoKeCenter.vue";
import UserInfo from "../pages/UserInfoPage.vue";
import GenderSelectPage from "../pages/GenderSelectPage.vue";
import ApplyCenter from "../pages/ApplyCenter.vue";
import SelectUserCenter from "../pages/SelectUserCenter.vue";
import SearchUserResultByUserAccountPage from "../pages/SearchUserResultByUserAccountPage.vue";
import AllMyFriend from "../pages/AllMyFriend.vue";
import TeamAddPage from "../pages/TeamAddPage.vue";
import SearchEsMorePage from "../pages/SearchEsMorePage.vue";
import ProtocolPage from "../pages/ProtocolPage.vue";
import AiChatPage from "../pages/AiChatPage.vue";
import AiAssistantPage from "../pages/AiAssistantPage.vue";
import GeoSearchUserPage from "../pages/GeoSearchUserPage.vue";
import GaodeMapPage from "../pages/GaodeMapPage.vue";
import MorePage from "../pages/MorePage.vue";
import WorkerBenchPage from "../pages/WorkBenchPage.vue";
import UserComplexEditPage from "../pages/UserComplexEditPage.vue";
import DocumentManagePage  from "../pages/DocumentManagePage.vue";

const routes = [
    // 根路径重定向到登录页面
    {
        path: '/',
        redirect: '/login',
    },
    {
        path: '/login',
        component: Login,
        name:'登录',
        // 在这里添加单独的路由守卫
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/register',
        component: Register,
        name:'注册',
        // 在这里添加单独的路由守卫
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/register/success',
        component: RegisterSuccess,
        name:'注册成功',
        // 在这里添加单独的路由守卫
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/index',
        component: Index,
        name:'首页',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/team',
        component: Team,
        name: '队伍',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/user',
        component: UserCenter,
        name: '用户中心',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/search',
        component: Search,
        name: '搜索用户',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/user/edit',
        component: UserEdit,
        name: '用户修改',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/user/complex-edit',
        component: UserComplexEditPage,
        name: '复杂编辑',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    // 任务管理相关路由
    {
        path: '/task/manage',
        component: TaskManagePage,
        name: '任务管理',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/task/detail/:id',
        component: TaskDetailPage,
        name: '详细任务',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/task/add',
        component: TaskAddEditPage,
        name: '新增任务',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/task/edit/:id',
        component: TaskAddEditPage,
        name: '编辑任务',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/task/assign/:id',
        component: TaskAssignPage,
        name: '分配任务',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/user/searchResult',
        component: SearchUserResultPage,
        name: '伙伴匹配',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/team/add',
        component: AddTeam,
        name: '添加队伍',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/team/infoByOne',
        component: TeamInfo,
        name: '队伍详情',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/chat',
        component: ChatPage,
        name: '聊天室',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/chatCenter',
        component: ChatCenter,
        name: '聊天空间',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/chat/info',
        component: ChatInfoPage,
        name: '聊天信息',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/tagsSelect',
        component: TagsSelectPage,
        name: '标签选择',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/memberCenter',
        component: MemberCenter,
        name: '会员中心',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/bokeCenter',
        component: BoKeCenter,
        name: '博客中心',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/userInfo',
        component: UserInfo,
        name: '用户信息',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path:'/genderSelect',
        component: GenderSelectPage,
        name:'性别选择',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path:'/applyCenter',
        component: ApplyCenter,
        name:'新的朋友',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path:'/selectUserCenter',
        component: SelectUserCenter,
        name:'查找用户',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path:'/selectResultAccount',
        component: SearchUserResultByUserAccountPage,
        name:'伙伴匹配',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path:'/selectES',
        component: SearchEsMorePage,
        name:'伙伴匹配',
        beforeEnter: (to, from) => {
            document.title = to.name
        },
    },
    {
        path: '/myFriends',
        component: AllMyFriend,
        name: '好友列表',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/teamAdd',
        component: TeamAddPage,
        name: '加入队伍',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/protocol',
        component: ProtocolPage,
        name: '会员协议',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/aiChat',
        component: AiChatPage,
        name: 'AI聊天',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/aiAssistant',
        component: AiAssistantPage,
        name: 'AI助手',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/geoSearch',
        component: GeoSearchUserPage,
        name: 'Geo搜索',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/gaode',
        component: GaodeMapPage,
        name: '高德定位',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/more',
        component: MorePage,
        name: '更多',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/workbench',
        component: WorkerBenchPage,
        name: '工作台',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    },
    {
        path: '/document/manage',
        component: DocumentManagePage,
        name: '文档管理',
        beforeEnter: (to, from) => {
            document.title = to.name
        }
    }
]

export default routes;